<template>
	<view>
		<u-navbar
		:is-back="true" 
		:background="{backgroundColor: '#F9D854',}"
		title="搜索" 
		title-width="325" 
		title-color="#ffffff" 
		title-size="35" 
		backIconColor="#ffffff"
		:border-bottom="false"
		></u-navbar>
		<search :is-focus="true" :theme="themeClass" :show-want="true" :speechEngine="speechEngine"
		:hot-list="hotList" @getSearchText="getSearchText"></search>
	</view>
</template>

<script>
	import search from '@/components/search/search.vue'
	export default {
		components: {
			search
		},
		data() {
			return {
				themeClass: 'block',
				speechEngine: 'baidu', //语音识别引擎
				hotList: ['暴富','2022','红包','虎','福','土味情话','虎年'],//初始化推荐列表
				isSearch: false
			}
		},onShareTimeline() {
			var share = {
				share_title: "节日头像",
				share_desc: "节日头像",
				share_img: ""
			}
			if(this.appconfig.shareInfo.status == 1){
				share = this.appconfig.shareInfo
			}
			return {
				title: share.share_title,
				imageUrl: share.share_img,
				desc: share.share_desc,
			}
		},
		onShareAppMessage() {
			var share = {
				share_title: "节日头像",
				share_desc: "节日头像",
				share_img: ""
			}
			if(this.appconfig.shareInfo.status == 1){
				share = this.appconfig.shareInfo
			}
			return {
				title: share.share_title,
				imageUrl: share.share_img,
				desc: share.share_desc,
			}
		},
		methods: {
			getSearchText(e) {
				if(this.isSearch){
					uni.showToast({
						icon: 'none',
						title: '太快啦，歇一会再试试',
						mask: true,
						duration: 1000
					})
					return
				}
				this.isSearch = true
				uni.navigateTo({
					url: '/pages/list/list?keyword='+e
				})
				this.isSearch = false
			}
		},
	}
</script>

<style>
</style>